package com.freesun.shop;

import cn.hutool.core.lang.Snowflake;
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
@EnableDubbo
@MapperScan("com.freesun.shop.mapper")
public class OrderServiceApp {
    public static void main(String[] args) {
        SpringApplication.run(OrderServiceApp.class, args);
    }

    @Value("${ID.workId}")
    private Integer wordId;
    @Value("${ID.dataId}")
    private Integer dataId;
    @Bean
    public Snowflake snowflake() {
        return new Snowflake(wordId,dataId);
    }
}
